﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="ChuyenNghanh.aspx.cs" Inherits="WTSQCB.ChuyenNghanh" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý chuyên nghành</p>
    <p>
        &nbsp;
        <asp:Label ID="Label1" runat="server" Text="Thuộc Khoa:"></asp:Label>
        &nbsp;&nbsp;&nbsp; <asp:DropDownList ID="KhoaDropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="TenKhoa" DataValueField="MaKhoa" Width="200px" AutoPostBack="True">
        </asp:DropDownList>
    </p>
    <p>
        <asp:GridView ID="ChuyenNganhGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaChuyenNganh" DataSourceID="SqlDataSource2" OnSelectedIndexChanged="ChuyenNganhGridView1_SelectedIndexChanged" Width="980px">
            <Columns>
                <asp:CommandField ButtonType="Button" SelectText="CHỌN" ShowSelectButton="True" />
                <asp:BoundField DataField="MaChuyenNganh" HeaderText="Mã chuyên ngành" ReadOnly="True" SortExpression="MaChuyenNganh" />
                <asp:BoundField DataField="TenChuyenNganh" HeaderText="Tên chuyên ngành" SortExpression="TenChuyenNganh" />
                <asp:BoundField DataField="TenKhoa" HeaderText="Tên khoa" SortExpression="TenKhoa" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="ThemButton1" runat="server" OnClick="ThemButton1_Click" Text="THÊM" Width="80px" />
        &nbsp;
        <asp:Button ID="SuaButton2" runat="server" OnClick="SuaButton2_Click" Text="SỬA" Width="80px" />
        &nbsp;
        <asp:Button ID="XoaButton3" runat="server" OnClick="XoaButton3_Click" Text="XÓA" OnClientClick="return confirm('Bạn có muốn XÓA không ?')" Width="80px"/>
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:</p>
    <p>
        &nbsp;
        <asp:Label ID="Label2" runat="server" Text="Mã chuyên ngành: "></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="MaChuyenNganhTextBox1" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaChuyenNganhTextBox1" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Mã chuyên ngành không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        <asp:Label ID="Label3" runat="server" Text="Tên chuyên ngành: "></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TenChuyenNganhTextBox2" runat="server" Width="200px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenChuyenNganhTextBox2" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Tên chuyên ngành không được để trống</asp:RequiredFieldValidator>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [Khoa]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="ChuyenNganhLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="KhoaDropDownList1" Name="makhoa" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>
